package com.wedimob.plugins.scrapper;

import java.net.URI;
import java.util.List;

import com.wedimob.bo.SerializableBO;
import com.wedimob.content.Content;
import com.wedimob.plugins.SimplePlugin;
import com.wedimob.query.SearchCriteria;

public interface Scrapper extends SimplePlugin {

	/**
	 * Can handle this kind of content
	 * 
	 * @param criteria
	 *            search criteria
	 * @param content
	 *            data
	 * @return status
	 */
	boolean accept(SearchCriteria criteria, Content content);

	/**
	 * check if current content is a list
	 * 
	 * @param criteria
	 *            search criteria
	 * @param content
	 *            data
	 * @return status
	 */
	boolean islist(SearchCriteria criteria, Content content);

	/**
	 * Convert a generic content to specific content
	 * 
	 * @param criteria
	 *            search criteria
	 * @param content
	 *            generic
	 * @return specific content
	 */
	SerializableBO<?> single(SearchCriteria criteria, Content content);

	/**
	 * Convert a generic content to specific content
	 * 
	 * @param criteria
	 *            search criteria
	 * @param content
	 *            generic
	 * @return list of generic content
	 */
	List<SerializableBO<?>> list(SearchCriteria criteria, Content content);

	/**
	 * Generate uri to explore for given criteria search
	 * 
	 * @param criteria
	 *            data
	 * @return uris to explore
	 */
	List<URI> uris(SearchCriteria criteria);

	/**
	 * 
	 * @return max concurrent access
	 */
	int maxConcurrentAccess();
}
